<?php

/**
 * TaskLocation form base class.
 *
 * @method TaskLocation getObject() Returns the current form's model object
 *
 * @package    lbreminder
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseTaskLocationForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'            => new sfWidgetFormInputHidden(),
      'latitude'      => new sfWidgetFormInputText(),
      'longitude'     => new sfWidgetFormInputText(),
      'street_number' => new sfWidgetFormInputText(),
      'street_name'   => new sfWidgetFormInputText(),
      'suburb'        => new sfWidgetFormInputText(),
      'postcode'      => new sfWidgetFormInputText(),
      'state'         => new sfWidgetFormInputText(),
      'country'       => new sfWidgetFormInputText(),
      'landmark_id'   => new sfWidgetFormPropelChoice(array('model' => 'Landmark', 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'id'            => new sfValidatorPropelChoice(array('model' => 'TaskLocation', 'column' => 'id', 'required' => false)),
      'latitude'      => new sfValidatorNumber(array('required' => false)),
      'longitude'     => new sfValidatorNumber(array('required' => false)),
      'street_number' => new sfValidatorInteger(array('min' => -2147483648, 'max' => 2147483647, 'required' => false)),
      'street_name'   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'suburb'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'postcode'      => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'state'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'country'       => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'landmark_id'   => new sfValidatorPropelChoice(array('model' => 'Landmark', 'column' => 'id', 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('task_location[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'TaskLocation';
  }


}
